<template>
    <div class="wrapper">
        <div class="talentRecommend" v-for="(item, index) in talentList" :key="index" @click="toDetail(item)">
            <div class="card">
                <div class="person-info">
                    <div class="text-wrap">
                        <div class="row-wrap">
                            <div style="text-align: left; width: 45%;">
                                <span class="title">姓名:</span>
                                <span class="content"> {{ item.name }} </span>
                            </div>
                            <div style="text-align: left; flex: 1;">
                                <span class="title">性别:</span>
                                <span class="content"> {{ item.genderName }} </span>
                            </div>
                        </div>
                        <div class="row-wrap">
                            <div style="text-align: left; width: 45%;">
                                <span class="title">学历:</span>
                                <span class="content"> {{ item.educationName }} </span>
                            </div>
                            <div style="text-align: left; flex: 1;display: flex;">
                                <span class="title">专业:</span>
                                <span class="content"> {{ item.major }} </span>
                            </div>
                        </div>
                        <div style="text-align: left; width: 100%;">
                            <span class="title">职业技能:</span>
                            <span class="content"> {{ item.skill }} </span>
                        </div>
                    </div>
                    <div class="headImg">
                        <img :src="item.headUrl" >
                    </div>
                </div>
                <div class="desc">
                    经验描述: {{ item.experienceDesc }}
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    // api
	import {request} from '@/utils/request.js'
	import config from '@/utils/config.js'

    export default {
        name: "talentRecommend",
        data() {
            return {
                talentList: [
                    // {
                    //     "id": 19,
                    //     "title": "刘XX-建筑自动化工程师",
                    //     "name": "刘XX",
                    //     "gender": "1",
                    //     "genderName": "男",
                    //     "birthMonth": "1992-02-01",
                    //     "education": "3",
                    //     "educationName": "全日制本科",
                    //     "nativePlace": "广东",
                    //     "nation": "1",
                    //     "nationName": "汉族",
                    //     "maritalStatus": "2",
                    //     "maritalStatusName": "已婚",
                    //     "contact": "13800138000",
                    //     "major": "城市建筑与规划",
                    //     "skill": "城市开发建设工程师",
                    //     "idCard": "445121199502262611",
                    //     "expectTrade": "建筑",
                    //     "permanentAddress": "广东省/广州市/海珠区/雅居乐",
                    //     "permanentAddressCascader": null,
                    //     "expectSalary": 10000,
                    //     "address": "广东省/广州市/海珠区/雅居乐",
                    //     "addressCascader": null,
                    //     "headUrl": "https://hiforce-oss-sz-dev.oss-cn-shenzhen.aliyuncs.com/smart-city/event-file-upload/20210520/9c48fa688a95e2e69efdfb352b59b2b4.jpg",
                    //     "status": "1",
                    //     "experienceDesc": "经验描述：负责施耐德数字平台（电力监控电能管理系统）在客户处的项目实施交付",
                    //     "createUser": "admin",
                    //     "createTime": "2021-05-24T16:44:27.000+0800",
                    //     "updateUser": null,
                    //     "updateTime": null
                    // },
                    // {
                    //     "id": 19,
                    //     "title": "刘XX-建筑自动化工程师",
                    //     "name": "刘XX",
                    //     "gender": "1",
                    //     "genderName": "男",
                    //     "birthMonth": "1992-02-01",
                    //     "education": "3",
                    //     "educationName": "大专",
                    //     "nativePlace": "广东",
                    //     "nation": "1",
                    //     "nationName": "汉族",
                    //     "maritalStatus": "2",
                    //     "maritalStatusName": "已婚",
                    //     "contact": "13800138000",
                    //     "major": "城市建筑",
                    //     "skill": "工程师",
                    //     "idCard": "445121199502262611",
                    //     "expectTrade": "建筑",
                    //     "permanentAddress": "广东省/广州市/海珠区/雅居乐",
                    //     "permanentAddressCascader": null,
                    //     "expectSalary": 10000,
                    //     "address": "广东省/广州市/海珠区/雅居乐",
                    //     "addressCascader": null,
                    //     "headUrl": "https://hiforce-oss-sz-dev.oss-cn-shenzhen.aliyuncs.com/smart-city/event-file-upload/20210520/9c48fa688a95e2e69efdfb352b59b2b4.jpg",
                    //     "status": "1",
                    //     "experienceDesc": "经验描述：负责施耐德数字平台（电力监控电能管理系统）在客户处的项目实施交付",
                    //     "createUser": "admin",
                    //     "createTime": "2021-05-24T16:44:27.000+0800",
                    //     "updateUser": null,
                    //     "updateTime": null
                    // },
                    // {
                    //     "id": 19,
                    //     "title": "刘XX-建筑自动化工程师",
                    //     "name": "刘XX",
                    //     "gender": "1",
                    //     "genderName": "男",
                    //     "birthMonth": "1992-02-01",
                    //     "education": "3",
                    //     "educationName": "大专",
                    //     "nativePlace": "广东",
                    //     "nation": "1",
                    //     "nationName": "汉族",
                    //     "maritalStatus": "2",
                    //     "maritalStatusName": "已婚",
                    //     "contact": "13800138000",
                    //     "major": "城市建筑",
                    //     "skill": "工程师",
                    //     "idCard": "445121199502262611",
                    //     "expectTrade": "建筑",
                    //     "permanentAddress": "广东省/广州市/海珠区/雅居乐",
                    //     "permanentAddressCascader": null,
                    //     "expectSalary": 10000,
                    //     "address": "广东省/广州市/海珠区/雅居乐",
                    //     "addressCascader": null,
                    //     "headUrl": "https://hiforce-oss-sz-dev.oss-cn-shenzhen.aliyuncs.com/smart-city/event-file-upload/20210520/9c48fa688a95e2e69efdfb352b59b2b4.jpg",
                    //     "status": "1",
                    //     "experienceDesc": "经验描述1",
                    //     "createUser": "admin",
                    //     "createTime": "2021-05-24T16:44:27.000+0800",
                    //     "updateUser": null,
                    //     "updateTime": null
                    // },
                    // {
                    //     "id": 19,
                    //     "title": "刘XX-建筑自动化工程师",
                    //     "name": "刘XX",
                    //     "gender": "1",
                    //     "genderName": "男",
                    //     "birthMonth": "1992-02-01",
                    //     "education": "3",
                    //     "educationName": "大专",
                    //     "nativePlace": "广东",
                    //     "nation": "1",
                    //     "nationName": "汉族",
                    //     "maritalStatus": "2",
                    //     "maritalStatusName": "已婚",
                    //     "contact": "13800138000",
                    //     "major": "城市建筑",
                    //     "skill": "工程师",
                    //     "idCard": "445121199502262611",
                    //     "expectTrade": "建筑",
                    //     "permanentAddress": "广东省/广州市/海珠区/雅居乐",
                    //     "permanentAddressCascader": null,
                    //     "expectSalary": 10000,
                    //     "address": "广东省/广州市/海珠区/雅居乐",
                    //     "addressCascader": null,
                    //     "headUrl": "https://hiforce-oss-sz-dev.oss-cn-shenzhen.aliyuncs.com/smart-city/event-file-upload/20210520/9c48fa688a95e2e69efdfb352b59b2b4.jpg",
                    //     "status": "1",
                    //     "experienceDesc": "经验描述1",
                    //     "createUser": "admin",
                    //     "createTime": "2021-05-24T16:44:27.000+0800",
                    //     "updateUser": null,
                    //     "updateTime": null
                    // },
                    // {
                    //     "id": 19,
                    //     "title": "刘XX-建筑自动化工程师",
                    //     "name": "刘XX",
                    //     "gender": "1",
                    //     "genderName": "男",
                    //     "birthMonth": "1992-02-01",
                    //     "education": "3",
                    //     "educationName": "大专",
                    //     "nativePlace": "广东",
                    //     "nation": "1",
                    //     "nationName": "汉族",
                    //     "maritalStatus": "2",
                    //     "maritalStatusName": "已婚",
                    //     "contact": "13800138000",
                    //     "major": "城市建筑",
                    //     "skill": "工程师",
                    //     "idCard": "445121199502262611",
                    //     "expectTrade": "建筑",
                    //     "permanentAddress": "广东省/广州市/海珠区/雅居乐",
                    //     "permanentAddressCascader": null,
                    //     "expectSalary": 10000,
                    //     "address": "广东省/广州市/海珠区/雅居乐",
                    //     "addressCascader": null,
                    //     "headUrl": "https://hiforce-oss-sz-dev.oss-cn-shenzhen.aliyuncs.com/smart-city/event-file-upload/20210520/9c48fa688a95e2e69efdfb352b59b2b4.jpg",
                    //     "status": "1",
                    //     "experienceDesc": "经验描述1",
                    //     "createUser": "admin",
                    //     "createTime": "2021-05-24T16:44:27.000+0800",
                    //     "updateUser": null,
                    //     "updateTime": null
                    // },
                    // {
                    //     "id": 20,
                    //     "title": "黄XX-AI人工智能工程师",
                    //     "name": "黄XX",
                    //     "gender": "2",
                    //     "genderName": "女",
                    //     "birthMonth": "1998-06-01",
                    //     "education": "5",
                    //     "educationName": "研究生",
                    //     "nativePlace": "广东",
                    //     "nation": "1",
                    //     "nationName": "汉族",
                    //     "maritalStatus": "1",
                    //     "maritalStatusName": "未婚",
                    //     "contact": "13800138666",
                    //     "major": "计算机人工智能",
                    //     "skill": "工程师",
                    //     "idCard": "440510199011100430",
                    //     "expectTrade": "AI",
                    //     "permanentAddress": "青海省/西宁市/城东区/富华雅居",
                    //     "permanentAddressCascader": null,
                    //     "expectSalary": 20000,
                    //     "address": "广东省/汕头市/濠江区/恒大金碧御景湾",
                    //     "addressCascader": null,
                    //     "headUrl": "https://hiforce-oss-sz-dev.oss-cn-shenzhen.aliyuncs.com/smart-city/event-file-upload/20210520/502dfbdc2089e7734745999319774dfc.png",
                    //     "status": "2",
                    //     "experienceDesc": "经验描述2",
                    //     "createUser": "admin",
                    //     "createTime": "2021-05-24T16:44:27.000+0800",
                    //     "updateUser": "admin",
                    //     "updateTime": "2021-05-24T16:45:48.000+0800"
                    // }
                ]
            }
        },
        // mounted(){
		// 	this.getTalentList();
        // },
        activated() {
            this.getTalentList();
        },
        methods:{
            // 获取人才列表
			async getTalentList(){
				let data = {
					pageNum: 1,
					pageSize: 6,
					education: '',
					quickSearch: ''
				}
				const { code, msg, rows} = await request(this, config.api.talentList, data, 'GET');
				if(code != '200') return this.$message.warning(msg);
				this.talentList = rows;
			},
			/**
			 * 立即申请
			 */
			toDetail(item) {
				this.$router.push({ name: 'talentRecommendDetail', params: { talent: JSON.stringify(item), isHelp: true } });
			}
        }
    }
</script>

<style scoped>
    .wrapper{
        display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
    }
    .wrapper .talentRecommend {
        width: 322px;
        /* height: 167px; */
        background-color: #f1f2f4;
        padding: 8px;
        margin-bottom: 20px;
        box-sizing: border-box;
    }

    .wrapper .talentRecommend .card {
        width: 100%;
        height: 100%;
        background-color: #fff;
        padding: 10px;
        box-sizing: border-box;
    }

    .wrapper .talentRecommend .card:hover{
        cursor: pointer;
    }

    .wrapper .talentRecommend .card .person-info {
        font-size: 14px;
        display: flex;
        margin-bottom: 20px;
    }

    .wrapper .talentRecommend .card .person-info .text-wrap{
        flex: 1;
    }

    .wrapper .talentRecommend .card .person-info .text-wrap .row-wrap{
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
    }

    .wrapper .talentRecommend .card .person-info .text-wrap .title {
        display: inline-block;
        color: #7a7a7a;
    }
    .wrapper .talentRecommend .card .person-info .text-wrap .title::before{
        content: "";
        display: inline-block;
        width: 2px;
        height: 2px;
        margin-right: 3px;
        vertical-align: middle;
        border-radius: 50%;
        background-color: #7a7a7a;
    }

    .wrapper .talentRecommend .card .person-info .text-wrap .content {
        width: 100px;
        color: #333;
        overflow:hidden;
        white-space:nowrap;
        text-overflow:ellipsis;
    }

    .wrapper .talentRecommend .card .person-info .headImg{
        width: 31px;
    }
    .wrapper .talentRecommend .card .person-info .headImg img{
        width: 31px;
        height: 31px;
        border-radius: 50%;
    }

    .wrapper .talentRecommend .card .desc {
        font-size: 12px;
        color: #999;
        text-align: left;
    }
</style>